package com.share.PACManager.task;

import android.content.Context;
import android.os.Handler;
import android.os.Message;

public class SearchPoliceTask extends Thread{

	private SearchPoliceListener mListener;
	private Context mContext;
	
	public interface SearchPoliceListener {
		public void onCheckResult(boolean result);
	}

	public SearchPoliceTask(Context context) {
		mContext = context;
	}
	
	public void searchPolice(SearchPoliceListener listener) {
		mListener = listener;	
		start();
	}
	
	Handler handler = new Handler(){		
		@Override
		public void handleMessage(Message msg)
		{
			if (mListener != null)
				mListener.onCheckResult(true);
		}
	};

	@Override
	public void run() {
		try {
			Thread.sleep(500);
			handler.sendEmptyMessage(1);

		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		super.run();
	}
}
